from datetime import datetime
from sqlalchemy import Column, Integer, String, Text, ForeignKey, DateTime
from sqlalchemy.dialects.mysql import MEDIUMTEXT

from Model.default import Base
class community_index_pre(Base):
    __tablename__ = 'community_index_pre'
    id = Column(Integer, primary_key=True)
    txt=Column(Text)
    images=Column(Text)
    title=Column(String(50))
    create_time=Column(String(20))
    date=Column(String(20))




class community_index_hottips(Base):
    __tablename__ = 'community_index_hottips'
    id=Column(Integer, primary_key=True,default=1,autoincrement=True)


class user_to_community_expand(Base):
    __tablename__ = 'user_to_community_expand'
    id=Column(Integer, primary_key=True,default=1)
    user_id = Column(Integer, ForeignKey('user.id'))
    search_history=Column(Text)
    # 偏向,爱好
    tendency_likes=Column(Text)

class community_writer_swiper(Base):
    __tablename__ = 'community_writer_swiper'
    # 简单处理,只存不删除
    id=Column(Integer, primary_key=True,autoincrement=True)
    content=Column(MEDIUMTEXT)
    date = Column(DateTime, default=lambda: datetime.now().replace(microsecond=0))

